package com.fccommunity.base;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.fccommunity.R;
import com.fccommunity.manager.ActivityManager;
import com.fccommunity.widget.TitleBar;

/**
 * Created by yiwei on 16/4/16.
 */
public abstract  class BaseActivity extends AppCompatActivity {

    protected static String TAG = "";
    protected Context context = null;

    protected int screenWidth = 0;
    protected int screenHeight = 0;
    protected float screenDensity = 0.0f;
    protected TitleBar titleBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TAG = getClass().getSimpleName();
        context = this;
        ActivityManager.getInstance().addActivity(this);
    }

    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        titleBar = (TitleBar) findViewById(R.id.main_title_bar);
        if(titleBar!=null){
            titleBar.getTitleView().setTextColor(getResources().getColor(R.color.white));
        }
        initTitle();
    }

    protected abstract void initTitle();
}
